﻿<%@ Page Title="User Settings" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Settings.aspx.cs" Inherits="SpessartiteTwitter.Registered.Settings" %>

<asp:Content ID="ContentSettings" ContentPlaceHolderID="MainContent" runat="server">

    <asp:FormView runat="server" ID="FormViewSettings"
        ItemType="SpessartiteTwitter.Data.AspNetUser"
        SelectMethod="FormViewSettings_GetItem"
        DefaultMode="Edit"
        DataKeyNames="Id"
        UpdateMethod="FormViewSettings_UpdateItem">
        <EditItemTemplate>
            <div class="container">
                <div class="row">
                    <div class="span12">
                        <h2><%# Item.UserName  + "'s Profile" %></h2>
                        <hr />
                    </div>
                </div>
                <div class="row">
                    <div class="span6">
                        <ol>
                            <asp:DynamicEntity runat="server" Mode="Edit"></asp:DynamicEntity>
                        </ol>
                    </div>
                    <div class="span6">
                        <img class="img-rounded" width="200" height="200" src="<%#: Item.Picture != null ? "data:image/png;base64," + Convert.ToBase64String(Item.Picture) : "../Images/profile_placeholder.gif" %>" alt="<%#: Item.UserName + "'s profile picture" %>" /><br />
                        <br />
                        <asp:FileUpload runat="server" ID="ProfilePictureFileUpload" CssClass="btn" />
                        <div>
                            <hr />
                            <asp:Panel ID="CheckboxlistHolder" runat="server" Visible="false">
                                <h4>Roles</h4>
                                <asp:CheckBoxList ID="CheckBoxListRoles" runat="server"
                                    ItemType="SpessartiteTwitter.Data.AspNetRole"
                                    SelectMethod="CheckBoxListRoles_GetAll"
                                    DataTextField="Name"
                                    DataValueField="Id"
                                    OnDataBound="CheckBoxListRoles_DataBound"/>
                            </asp:Panel>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="span12 text-center">
                        <asp:LinkButton ID="ButtonSaveChanges" CommandName="Update"
                            Text="Save changes" runat="server" CssClass="btn btn-success save-changes-btn" Style="width: 350px;" />
                    </div>
                </div>
            </div>
        </EditItemTemplate>
    </asp:FormView>
</asp:Content>
